package com.java.model;

import java.util.List;

import javax.swing.table.DefaultTableModel;

import com.java.entity.TodoList;

/**
* @ClassName: TodoTableModel
* 待办表格映射实体类
*
 */
public class TodoTableModel extends DefaultTableModel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public TodoTableModel(List<TodoList> data) {
		super(new Object[] { "Title", "Priority", "Start", "End", "CreateTime" }, 0);
		if(null != data) {
			for (TodoList todo : data) {
				addRow(new Object[] { todo.getTitle(), todo.getLevel(), todo.getStartTime(), todo.getEndTime(),
						todo.getCreateTime() });
			}
		}
	}

	@Override
	public boolean isCellEditable(int row, int column) {
		return false;
	}
}